<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>ggsvd</title>
<link rel="stylesheet" href="../../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../../index.html" title="Chapter&#160;1.&#160;Boost.Numeric_Bindings">
<link rel="up" href="../driver_routines.html" title="Driver Routines">
<link rel="prev" href="ggevx.html" title="ggevx">
<link rel="next" href="hbgv.html" title="hbgv">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ggevx.html"><img src="../../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../driver_routines.html"><img src="../../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../images/home.png" alt="Home"></a><a accesskey="n" href="hbgv.html"><img src="../../../../images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_numeric_bindings.reference.lapack.driver_routines.ggsvd"></a><a class="link" href="ggsvd.html" title="ggsvd">ggsvd</a>
</h5></div></div></div>
<a name="boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.prototype"></a><h6>
<a name="id814718"></a>
            <a class="link" href="ggsvd.html#boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.prototype">Prototype</a>
          </h6>
<p>
            There is one prototype of <code class="computeroutput"><span class="identifier">ggsvd</span></code>
            available, please see below. 
</p>
<pre class="programlisting"><span class="identifier">ggsvd</span><span class="special">(</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="identifier">jobu</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="identifier">jobv</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="identifier">jobq</span><span class="special">,</span>
        <span class="identifier">int_t</span><span class="special">&amp;</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">int_t</span><span class="special">&amp;</span> <span class="identifier">l</span><span class="special">,</span> <span class="identifier">MatrixA</span><span class="special">&amp;</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">MatrixB</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">,</span>
        <span class="identifier">VectorALPHA</span><span class="special">&amp;</span> <span class="identifier">alpha</span><span class="special">,</span> <span class="identifier">VectorBETA</span><span class="special">&amp;</span> <span class="identifier">beta</span><span class="special">,</span> <span class="identifier">MatrixU</span><span class="special">&amp;</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">MatrixV</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span>
        <span class="identifier">MatrixQ</span><span class="special">&amp;</span> <span class="identifier">q</span> <span class="special">);</span>
</pre>
<p>
          </p>
<a name="boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.description"></a><h6>
<a name="id815054"></a>
            <a class="link" href="ggsvd.html#boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.description">Description</a>
          </h6>
<p>
            <code class="computeroutput"><span class="identifier">ggsvd</span></code> (short for $FRIENDLY_NAME)
            provides a C++ interface to LAPACK routines SGGSVD, DGGSVD, CGGSVD, and
            ZGGSVD. <code class="computeroutput"><span class="identifier">ggsvd</span></code> computes
            the generalized singular value decomposition (GSVD) of an M-by-N complex
            matrix A and P-by-N complex matrix B:
          </p>
<p>
            U'<span class="bold"><strong>A*Q = D1</strong></span>( 0 R ), V'<span class="bold"><strong>B*Q
            = D2</strong></span>( 0 R )
          </p>
<p>
            where U, V and Q are unitary matrices, and Z' means the conjugate transpose
            of Z. Let K+L = the effective numerical rank of the matrix (A',B')',
            then R is a (K+L)-by-(K+L) nonsingular upper triangular matrix, D1 and
            D2 are M-by-(K+L) and P-by-(K+L) "diagonal" matrices and of
            the following structures, respectively:
          </p>
<p>
            If M-K-L &gt;= 0,
          </p>
<p>
            K L D1 = K ( I 0 ) L ( 0 C ) M-K-L ( 0 0 )
          </p>
<p>
            K L D2 = L ( 0 S ) P-L ( 0 0 )
          </p>
<p>
            N-K-L K L ( 0 R ) = K ( 0 R11 R12 ) L ( 0 0 R22 ) where
          </p>
<p>
            C = diag( ALPHA(K+1), ... , ALPHA(K+L) ), S = diag( BETA(K+1), ... ,
            BETA(K+L) ), C<span class="bold"><strong>*2 + S</strong></span>*2 = I.
          </p>
<p>
            R is stored in A(1:K+L,N-K-L+1:N) on exit.
          </p>
<p>
            If M-K-L &lt; 0,
          </p>
<p>
            K M-K K+L-M D1 = K ( I 0 0 ) M-K ( 0 C 0 )
          </p>
<p>
            K M-K K+L-M D2 = M-K ( 0 S 0 ) K+L-M ( 0 0 I ) P-L ( 0 0 0 )
          </p>
<p>
            N-K-L K M-K K+L-M ( 0 R ) = K ( 0 R11 R12 R13 ) M-K ( 0 0 R22 R23 ) K+L-M
            ( 0 0 0 R33 )
          </p>
<p>
            where
          </p>
<p>
            C = diag( ALPHA(K+1), ... , ALPHA(M) ), S = diag( BETA(K+1), ... , BETA(M)
            ), C<span class="bold"><strong>*2 + S</strong></span>*2 = I.
          </p>
<p>
            (R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N), and R33 is stored ( 0
            R22 R23 ) in B(M-K+1:L,N+M-K-L+1:N) on exit.
          </p>
<p>
            The routine computes C, S, R, and optionally the unitary transformation
            matrices U, V and Q.
          </p>
<p>
            In particular, if B is an N-by-N nonsingular matrix, then the GSVD of
            A and B implicitly gives the SVD of A*inv(B): A<span class="bold"><strong>inv(B)
            = U</strong></span>(D1*inv(D2))*V'. If ( A',B')' has orthnormal columns, then
            the GSVD of A and B is also equal to the CS decomposition of A and B.
            Furthermore, the GSVD can be used to derive the solution of the eigenvalue
            problem: A'<span class="bold"><strong>A x = lambda</strong></span> B'*B x. In some
            literature, the GSVD of A and B is presented in the form U'*A*X = ( 0
            D1 ), V'*B*X = ( 0 D2 ) where U and V are orthogonal and X is nonsingular,
            and D1 and D2 are 
</p>
<pre class="programlisting"><span class="identifier">diagonal</span><span class="char">''</span><span class="special">.</span> <span class="identifier">The</span> <span class="identifier">former</span> <span class="identifier">GSVD</span> <span class="identifier">form</span> <span class="identifier">can</span> <span class="identifier">be</span> <span class="identifier">converted</span> <span class="identifier">to</span> <span class="identifier">the</span> <span class="identifier">latter</span>
<span class="identifier">form</span> <span class="identifier">by</span> <span class="identifier">taking</span> <span class="identifier">the</span> <span class="identifier">nonsingular</span> <span class="identifier">matrix</span> <span class="identifier">X</span> <span class="identifier">as</span>

<span class="identifier">X</span> <span class="special">=</span> <span class="identifier">Q</span><span class="special">*(</span> <span class="identifier">I</span> <span class="number">0</span> <span class="special">)</span>
<span class="special">(</span> <span class="number">0</span> <span class="identifier">inv</span><span class="special">(</span><span class="identifier">R</span><span class="special">)</span> <span class="special">)</span>

<span class="identifier">The</span> <span class="identifier">selection</span> <span class="identifier">of</span> <span class="identifier">the</span> <span class="identifier">LAPACK</span> <span class="identifier">routine</span> <span class="identifier">is</span> <span class="identifier">done</span> <span class="identifier">during</span> <span class="identifier">compile</span><span class="special">-</span><span class="identifier">time</span><span class="special">,</span> 
<span class="keyword">and</span> <span class="identifier">is</span> <span class="identifier">determined</span> <span class="identifier">by</span> <span class="identifier">the</span> <span class="identifier">type</span> <span class="identifier">of</span> <span class="identifier">values</span> <span class="identifier">contained</span> <span class="identifier">in</span> <span class="identifier">type</span> <span class="error">`</span><span class="identifier">MatrixA</span><span class="error">`</span><span class="special">.</span>
<span class="identifier">The</span> <span class="identifier">type</span> <span class="identifier">of</span> <span class="identifier">values</span> <span class="identifier">is</span> <span class="identifier">obtained</span> <span class="identifier">through</span> <span class="identifier">the</span> <span class="error">`</span><span class="identifier">value_type</span><span class="error">`</span> <span class="identifier">meta</span><span class="special">-</span><span class="identifier">function</span>
 <span class="error">`</span><span class="keyword">typename</span> <span class="identifier">value_type</span><span class="special">&lt;</span><span class="identifier">MatrixA</span><span class="special">&gt;::</span><span class="identifier">type</span><span class="error">`</span><span class="special">.</span>
<span class="identifier">The</span> <span class="identifier">dispatching</span> <span class="identifier">table</span> <span class="identifier">below</span> <span class="identifier">illustrates</span> <span class="identifier">to</span> <span class="identifier">which</span> <span class="identifier">specific</span> <span class="identifier">routine</span> 
<span class="identifier">the</span> <span class="identifier">code</span> <span class="identifier">path</span> <span class="identifier">will</span> <span class="identifier">be</span> <span class="identifier">generated</span><span class="special">.</span> 

<span class="special">[</span><span class="identifier">table</span> <span class="identifier">Dispatching</span> <span class="identifier">of</span> <span class="identifier">ggsvd</span>
<span class="special">[</span>  <span class="special">[</span> <span class="identifier">Value</span> <span class="identifier">type</span> <span class="identifier">of</span> <span class="identifier">MatrixA</span> <span class="special">]</span> <span class="special">[</span><span class="identifier">LAPACK</span> <span class="identifier">routine</span><span class="special">]</span> <span class="special">]</span>
<span class="special">[</span>  <span class="special">[</span><span class="error">`</span><span class="keyword">float</span><span class="error">`</span><span class="special">][</span><span class="identifier">SGGSVD</span><span class="special">]</span> <span class="special">]</span>
<span class="special">[</span>  <span class="special">[</span><span class="error">`</span><span class="keyword">double</span><span class="error">`</span><span class="special">][</span><span class="identifier">DGGSVD</span><span class="special">]</span> <span class="special">]</span>
<span class="special">[</span>  <span class="special">[</span><span class="error">`</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span><span class="error">`</span><span class="special">][</span><span class="identifier">CGGSVD</span><span class="special">]</span> <span class="special">]</span>
<span class="special">[</span>  <span class="special">[</span><span class="error">`</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span><span class="error">`</span><span class="special">][</span><span class="identifier">ZGGSVD</span><span class="special">]</span> <span class="special">]</span>

<span class="special">]</span>


<span class="special">[</span><span class="identifier">heading</span> <span class="identifier">Definition</span><span class="special">]</span>
<span class="identifier">Defined</span> <span class="identifier">in</span> <span class="identifier">header</span> <span class="special">[</span><span class="identifier">headerref</span> <span class="identifier">boost</span><span class="special">/</span><span class="identifier">numeric</span><span class="special">/</span><span class="identifier">bindings</span><span class="special">/</span><span class="identifier">lapack</span><span class="special">/</span><span class="identifier">driver</span><span class="special">/</span><span class="identifier">ggsvd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">].</span>


<span class="special">[</span><span class="identifier">heading</span> <span class="identifier">Parameters</span> <span class="keyword">or</span> <span class="identifier">Requirements</span> <span class="identifier">on</span> <span class="identifier">Types</span><span class="special">]</span>

<span class="special">[</span><span class="identifier">variablelist</span> <span class="identifier">Parameters</span>
    <span class="special">[[</span><span class="identifier">MatrixA</span><span class="special">]</span> <span class="special">[</span><span class="identifier">The</span> <span class="identifier">definition</span> <span class="identifier">of</span> <span class="identifier">term</span> <span class="number">1</span><span class="special">]]</span>
    <span class="special">[[</span><span class="identifier">MatrixB</span><span class="special">]</span> <span class="special">[</span><span class="identifier">The</span> <span class="identifier">definition</span> <span class="identifier">of</span> <span class="identifier">term</span> <span class="number">2</span><span class="special">]]</span>
    <span class="special">[[</span><span class="identifier">MatrixC</span><span class="special">]</span> <span class="special">[</span>
    <span class="identifier">The</span> <span class="identifier">definition</span> <span class="identifier">of</span> <span class="identifier">term</span> <span class="number">3.</span>

    <span class="identifier">Definitions</span> <span class="identifier">may</span> <span class="identifier">contain</span> <span class="identifier">paragraphs</span><span class="special">.</span>
    <span class="special">]]</span>
<span class="special">]</span>


<span class="special">[</span><span class="identifier">heading</span> <span class="identifier">Complexity</span><span class="special">]</span>


<span class="special">[</span><span class="identifier">heading</span> <span class="identifier">Example</span><span class="special">]</span>
</pre>
<p>
            #include &lt;boost/numeric/bindings/lapack/driver/ggsvd.hpp&gt; using
            namespace boost::numeric::bindings;
          </p>
<p>
            lapack::ggsvd( x, y, z );
          </p>
<p>
            
</p>
<pre class="programlisting"><span class="keyword">this</span> <span class="identifier">will</span> <span class="identifier">output</span>

</pre>
<p>
            [5] 0 1 2 3 4 5 <code class="computeroutput"></code>
          </p>
<a name="boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.notes"></a><h6>
<a name="id816686"></a>
            <a class="link" href="ggsvd.html#boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.notes">Notes</a>
          </h6>
<a name="boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.see_also"></a><h6>
<a name="id816711"></a>
            <a class="link" href="ggsvd.html#boost_numeric_bindings.reference.lapack.driver_routines.ggsvd.see_also">See
            Also</a>
          </h6>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
                Originating Fortran source files <a href="http://www.netlib.org/lapack/single/sggsvd.f" target="_top">sggsvd.f</a>,
                <a href="http://www.netlib.org/lapack/double/dggsvd.f" target="_top">dggsvd.f</a>,
                <a href="http://www.netlib.org/lapack/complex/cggsvd.f" target="_top">cggsvd.f</a>,
                and <a href="http://www.netlib.org/lapack/complex16/zggsvd.f" target="_top">zggsvd.f</a>
                at Netlib.
              </li></ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2002 -2009 Rutger ter Borg, Kre&#353;imir Fresl, Thomas Klimpel,
      Toon Knapen, Karl Meerbergen<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ggevx.html"><img src="../../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../driver_routines.html"><img src="../../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../images/home.png" alt="Home"></a><a accesskey="n" href="hbgv.html"><img src="../../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
